package homework.day03;


import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Random;

/**
 * 生成10个0-100之间的不重复的随机数,并输出
 * @author Xiloer
 *
 */
public class Test03 {
	public static void main(String[] args) {
		Random random = new Random();
		List<Integer> c = new ArrayList<>();
		while (c.size()<10){
			c.add(random.nextInt(101));
			Iterator<Integer> it = c.iterator();
			while(it.hasNext()){
				int x = it.next();
				while (it.hasNext()){
					if (x==it.next()){
						it.remove();
					}
				}
			}
		}
		System.out.println(c);

	}
}
